﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;
using System.Web.UI.WebControls;
using mojoPortal.Web.Controls;
using mojoPortal.Web.Framework;
using System.Globalization;

namespace ud_Video.UI
{
    public class VideoConfiguration
    {
        public VideoConfiguration() { }

        public VideoConfiguration(Hashtable settings)
        {
            LoadSettings(settings);
        }

        private void LoadSettings(Hashtable settings)
        {
            if (settings.Contains("CustomCssClassSetting"))
            {
                instanceCssClass = settings["CustomCssClassSetting"].ToString();
            }

            width = WebUtils.ParseInt32FromHashtable(settings, "WidthSetting", width);
            height = WebUtils.ParseInt32FromHashtable(settings, "HeightSetting", height);
            autoStart = WebUtils.ParseBoolFromHashtable(settings, "AutoStartSetting", autoStart);
            clickAutoStart = WebUtils.ParseBoolFromHashtable(settings, "ClickAutoStartSetting", clickAutoStart);
            useClickImageThumbnail = WebUtils.ParseBoolFromHashtable(settings, "UseClickImageThumbnailSetting", useClickImageThumbnail);
            useDropDownList = WebUtils.ParseBoolFromHashtable(settings, "UseDropDownListSetting", useDropDownList);
            useList = WebUtils.ParseBoolFromHashtable(settings, "UseListSetting", useList);
            numberVideo = WebUtils.ParseInt32FromHashtable(settings, "NumberVideoSetting", numberVideo);
        }
        private string instanceCssClass = string.Empty;
        public string InstanceCssClass { get { return instanceCssClass; } }
        
        private int width = 250;
        public int Width { get { return width; } }

        private int height = 200;
        public int Height { get { return height; } }

        private bool autoStart;
        public bool AutoStart { get { return autoStart; } }

        private bool clickAutoStart;
        public bool ClickAutoStart { get { return clickAutoStart; } }

        private bool useClickImageThumbnail;
        public bool UseClickImageThumbnail { get { return useClickImageThumbnail; } }
        
        private bool useDropDownList;
        public bool UseDropDownList { get { return useDropDownList; } }

        private bool useList;
        public bool UseList { get { return useList; } }

        private int numberVideo = 3;
        public int NumberVideo { get { return numberVideo; } }
    }
}